<template>
	<view class="u-demo">
		<view class="u-demo">
			<view style="border: 1px solid black;">
				<u-field v-model="mobile" label="标题" placeholder="请填写标题" maxlength="10">
				</u-field>
				<u-field type="textarea" label-width="0" v-model="value"></u-field>
				<view style="text-align: right;padding: 20rpx;">{{value.length}}/150字</view>
			</view>
			</br>
			<button @click="geting">提交</button>
		</view>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				value: '',
				mobile: '',
				base: api.baseurl,
			}
		},
		methods: {
			geting() {
				this.$post(this.base + '/prod-api/api/common/feedback', {
					"content": this.value,
					"title": this.mobile
				}).then((res) => {
					if (res.code == 200) {
						uni.showToast({
							title: "提交成功",
						})
						uni.switchTab({
							url:'../mine'
						})
						
						this.value = ''
						this.mobile = ''
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style>

</style>
